<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
        <script src="js/time.js?"></script>

		<script charset="utf-8" src="edit/kindeditor.js"></script>
		<script charset="utf-8" src="edit/lang/zh_CN.js"></script>
		<script charset="utf-8" src="edit/plugins/code/prettify.js"></script>
	
        <script>
        KindEditor.ready(function(K) {
            var editor1 = K.create('textarea[id="answer"]', {
                //width : w,
                cssPath: 'edit/plugins/code/prettify.css',
                uploadJson: 'edit/php/upload_json.php',
                fileManagerJson: 'edit/php/file_manager_json.php',
                allowFileManager: true,
                urlType: "domain",
                afterCreate: function() {
                    var self = this;
                    K.ctrl(document, 13, function() {
                        self.sync();
                        K('form[name=rowForm]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function() {
                        self.sync();
                        K('form[name=rowForm]')[0].submit();
                    });
                }
            });
            prettyPrint();
        });
        </script>
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <center><?=translate('ADD') ?></center>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
            
            	<tr><td><?= translate('BUGLIST_MANAGERPKG_PKGDETAIL') ?>:</td><td>
            	<input type="text" name='row[pkgdetail]' size='80px' id='pkgdetail'/></td></tr>
            	
            	<tr><td><?= translate('BUGLIST_MANAGERPKG_PKGNAME') ?>:</td><td>
            	<!--  
            	<input type="text" name='row[pkgname]' size='80px' id='pkgname'/>
            	-->
            	<select  name='row[pkgname]' id="pkgname" >
            		<?php foreach ($imglist as $key => $value) {?>
					<option value="<?=$key ?>"><?=$key ?></option>
					<?php }?>
           	    </select>
            	</td></tr>
            	
            	<tr><td><?= translate('BUGLIST_MANAGERPKG_PKGURL') ?>:</td><td>
            	<input type="text" name='row[pkgurl]' size='80px' id='pkgurl'/></td></tr>
                
                <tr><td><?= translate('BUGLIST_MANAGERPKG_PKGWEIGHT') ?>:</td><td>
            	<input type="text" name='row[pkgweight]' size='80px' id='pkgweight'/></td></tr>
                             
                <tr><td>
                </td><td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit"/> 
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="reset" value="<?= translate('RESET') ?>" id="reset"/></td></tr>
                
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#pkgdetail").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                //$("#pkgname").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#pkgurl").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#pkgweight").formValidator({empty: false, onshow: '<?= translate('C_NOT_EMPTY') ?>'}).regexValidator({regexp: 'num', datatype: 'enum', onerrormin: '<?= translate('C_ONLY_NUM') ?>'});
                });
        </script>
    </body>
</html>